1. Field of the Invention
The present invention is related to processing systems and processors, and more specifically to techniques for tracking use of hardware resources by lower privilege level processes.
2. Description of Related Art
In present-day processors, large numbers of hardware resources (or facilities) are available in each processing unit and multiple privilege levels and/or levels of virtualization are typically present during execution of programs in present-day systems. The hardware facilities within the processors are typically managed at the highest privilege level, which in multi-level virtualized systems is generally controlled by a hypervisor that manages availability and allocation of the hardware resources, such as processing units, to one or more operating systems images. In multi-level managed systems, supervisors, which are operating systems processes that schedule and manage the execution of applications, as well as managing operating systems internals, control the execution of applications by those operating systems images and are executed at a privilege level between that of the hypervisor and the applications.
In existing systems, application hardware facility usage is tracked by the supervisor so that when a context swap occurs within a partition, the supervisor can avoid some of the overhead associated with the context swap by saving/restoring only the states of the facilities that are used. However, in a multi-level managed system as described above, in order for the hypervisor to manage a partition context swap, the hypervisor must find out whether the supervisor(s) has registered use of a facility, and independent whether or not the facility has actually been used, the state of the facility must be saved and restored. Additionally, in order to avoid “covert channels”, in which an application or partition can obtain information from residual information remaining in the facility from a previous process, the state of the facility must always be restored or be written with an initializing state that replaces the contents of the facility's storage. Existing systems also lack discrete management for allocation of the hardware facilities as among the applications, the supervisor and the hypervisor.
It would therefore be desirable to provide a method for managing hardware facilities with more discrete management of hardware facilities as among the applications, the supervisor and the hypervisor.